<?php
//sleep(1);
preg_match('/[a-zA-Z0-9-_]+\.php$/', $_SERVER['SCRIPT_NAME'], $matches, PREG_OFFSET_CAPTURE);
$file = $matches[0][0];
?>

<!DOCTYPE HTML>
<html manifest="pjax.manifest">
<head>
  <meta charset="utf-8">

  <title>Photos w/ pjax</title>
  <link rel="stylesheet" href="css/style.css">
  <script src="js/jquery-1.6.1.min.js"></script>
  <script src="js/script.js"></script>
</head>
<body>
  <header>
  <h1><a href="index.php">HTML5 photos w/ pjax</a></h1>
  </header>
  <nav>
  <ul>
    <li <?php if($file == "index.php") echo "class=selected"; ?>><a class=js-pjax href="index.php"><img src="images/0.jpg"></a></li>
    <li <?php if($file == "1.php") echo "class=selected"; ?>><a class=js-pjax href="1.php"><img src="images/1.jpg"></a></li>
    <li <?php if($file == "2.php") echo "class=selected"; ?>><a class=js-pjax href="2.php"><img src="images/2.jpg"></a></li>
    <li <?php if($file == "3.php") echo "class=selected"; ?>><a class=js-pjax href="3.php"><img src="images/3.jpg"></a></li>
  </ul>
  </nav>
  <article id="content">

